package com.dream.service.user.dao;

import com.dream.service.user.domain.model.CountryModel;
import com.dream.service.user.domain.model.UserAddrModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by kangd on 2016/4/7.
 */
public interface UserAddrDao {

    /**
     *注册用户，增加新用户
     * @param userAddrModel
     * @return
     * @throws Exception
     */
    public int addUserAddr(UserAddrModel userAddrModel)  throws Exception;

    /**
     * 根据pin查询用户地址
     * @param pin
     * @return
     * @throws Exception
     */
    public List<UserAddrModel> selectByPIN(@Param("pin")String pin)  throws Exception;

    /**
     * 根据pin、receiving_id 查地址
     * @param pin
     * @param receiving_id
     * @return
     * @throws Exception
     */
    public UserAddrModel selectByReceivingID(@Param("pin")String pin,@Param("receiving_id")Integer receiving_id) throws  Exception;

    /**
     * 查默认用户地址
     * @param pin
     * @return
     * @throws Exception
     */
    public UserAddrModel selectByPINDefault(@Param("pin")String pin) throws  Exception;


    /**
     * 删除地址
     * @param pin
     * @return
     * @throws Exception
     */
    public int deleteUserAddrModel(@Param("pin")String pin,@Param("receiving_id")Integer receiving_id) throws  Exception;

    /**
     * 用户信息查询
     * @param userModel
     * @return
     * @throws Exception
     */
    //  public UserModel selectBySelective(UserModel userModel) throws  Exception;

    /**
     * 修改为默认地址
     * @param pin
     * @param receiving_id
     * @return
     * @throws Exception
     */
    public int updateUserDefaultAddr(@Param("pin")String pin,@Param("receiving_id")Integer receiving_id) throws  Exception;

    /**
     * 修改收货地址
     * @param userAddrModel
     * @return
     * @throws Exception
     */
    public int updateUserAddr(UserAddrModel userAddrModel) throws  Exception;

    /**
     *国家列表
     * @return
     * @throws Exception
     */
    public List<CountryModel> selectCountry(@Param("isFreq")Integer isFreq,@Param("scope_type") Integer scope_type) throws  Exception;
}
